﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once        
#include "IFamilyConstraint.h"
#include "GmFamilyService.h"


namespace gfam
{

    /// \brief  几何约束基类（平行，垂直，对称，相切...）
    class GM_FAMILY_SERVICE_EXPORT IFamilyGeometryConstraint : public IFamilyConstraint
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyGeometryConstraint, gfam::IFamilyConstraint)
    public:

        /// \brief 获取或者创建约束符号
        ///
        /// \param nodeReference 约束对象图形节点
        /// \param  displayFirst 优先显示
        /// \return 约束符号id
        virtual gcmp::ElementId GetOrCreateConstraintSymbol(const gcmp::IGraphicsNodeReference &nodeReference, bool displayFirst = false) const = 0;


        /// \brief 删除约束符号
        virtual void DeleteConstraintSymbols() const = 0;

        /// \brief 更新约束符号
        virtual void UpdateConstraintSymbols() const = 0;

        /// \brief 获取约束符号位置
        ///
        /// \param nodeReference 约束对象图形节点
        /// \param  constraintPosition 保存约束符号的位置
        /// \return 操作成功返回true,否则返回false
        virtual bool GetConstraintSymbolPosition(const gcmp::IGraphicsNodeReference& nodeReference, gcmp::Vector3d& constraintPosition) const = 0;

        /// \brief 获取约束在拾取时关联的对象
        ///
        /// \param objects 保存关联的对象
        virtual void GetAssociatedSelectionObjects(std::vector<gcmp::OwnerPtr<gcmp::IGraphicsNodeReference>>& objects) const = 0;

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();
    };
}